import request from '@/utils/request'
export const vmTypeSearchAPI = (params) => request({
  url: '/api/vm-service/vm/search',
  params
})
export const vmTypeAPI = (data) => request({
  url: '/api/vm-service/vmType',
  method: 'POST',
  data
})
export const vmvmTypeAPI = (params) => request({
  url: '/api/vm-service/vmType/search',
  params
})
export const vmnodeAPI = (params) => request({
  url: '/api/vm-service/node/search',
  params
})
export const addVmAPI = (createUserId, vmType, nodeId) => request({
  url: '/api/vm-service/vm',
  method: 'POST',
  data: {
    createUserId,
    vmType,
    nodeId
  }
})
export const policyAPI = () => request({
  url: '/api/vm-service/policy'
})
export const ApplypolicyAPI = (innerCodeList, policyId) => request({
  url: '/api/vm-service/vm/applyPolicy',
  method: 'PUT',
  data: {
    innerCodeList,
    policyId
  }
})
export const vmPolicyAPI = (innerCode) => request({
  url: `/api/vm-service/policy/vmPolicy/${innerCode}`
})
export const cancelPolicyApi = (innerCode, policyId) => request({
  url: `/api/vm-service/vm/cancelPolicy/${innerCode}/${policyId}`,
  method: 'PUT'
})
export const vminnerPolicyAPI = (innerCode) => request({
  url: `/api/vm-service/policy/vmPolicy/${innerCode}`
})
export const vmNodeAPI = (id, nodeId) => request({
  url: `/api/vm-service/vm/${id}/${nodeId}`,
  method: 'PUT'
})
export const orderCountAPI = (start, end, innerCode) => request({
  url: '/api/order-service/report/orderCount',
  params: {
    start,
    end,
    innerCode
  }
})
export const orderAmountAPI = (start, end, innerCode) => request({
  url: '/api/order-service/report/orderAmount',
  params: {
    start,
    end,
    innerCode
  }
})
export const skuCollectAPI = (start, end, innerCode) => request({
  url: `/api/order-service/report/skuCollect/${innerCode}/${start}/${end}`
})
export const repairCountAPI = (start, end, innerCode) => request({
  url: `/api/task-service/task/repairCount/${innerCode}/${start}/${end}`
})
export const supplyCountAPI = (start, end, innerCode) => request({
  url: `/api/task-service/task/supplyCount/${innerCode}/${start}/${end}`
})
export const editvmTypeAPI = (typeId, data) => request({
  url: `/api/vm-service/vmType/${typeId}`,
  method: 'PUT',
  data
})
export const channelListAPI = (innerCode) => request({
  url: `/api/vm-service/channel/channelList/${innerCode}`
})
export const businessTopAPI = (businessId) => request({
  url: `/api/vm-service/sku/businessTop10/${businessId}`
})
export const businessTypeAPI = () => request({
  url: `/api/vm-service/businessType`
})
export const skuSearchAPI = (pageIndex, pageSize,skuName) => request({
  url: `/api/vm-service/sku/search`,
  params: {
    pageIndex,
    pageSize,
    skuName
  }
})
